import 'package:json_annotation/json_annotation.dart';

part 'store.g.dart';

@JsonSerializable()
class StoreAttentionModel {

  String name;

  int news;

  int attention;

  String imgUrl;

  StoreAttentionModel({ required this.name, required this.news, required this.attention, required this.imgUrl });

  factory StoreAttentionModel.fromJson(Map<String, dynamic> json) =>
      _$StoreAttentionModelFromJson(json);

  Map<String, dynamic> toJson() => _$StoreAttentionModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}

@JsonSerializable()
class StoreListModel {
  String logo;

  String name;

  List<String> imgs;

  int collect;

  int year;

  StoreListModel({ required this.logo, required this.name, this.imgs = const [], required this.collect, required this.year });

  factory StoreListModel.fromJson(Map<String, dynamic> json) =>
      _$StoreListModelFromJson(json);

  Map<String, dynamic> toJson() => _$StoreListModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}